home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1199 / 1754 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  15.2 KB

  1. Subject: Re: Rsconf problems under MiNT 1.10h6
  2. Date: Fri, 22 Jul 1994 22:14:10 +0200 (CDT)
  3. From: Juergen Lock <nox@jelal.north.de>
  4.  
  5. In <memo.716071@cix.compulink.co.uk> you write:
  6. >Thanks to everybody who pointed me in the right direction for h6 patches.
  7. >I have now successfully built a h6 MTOS kernel.
  8. >
  9. >All seems to work fine except Rsconf().
  10. >
  11. >I first noticed this when MODEM.CPX displayed rubbish instead of the baud
  12. >rate. ...
  13.  
  14. hmm.  does this fix it?  (needs my later patches at least for the other parts)
  15.  
  16. 1. init_xbios gets called pretty late (after biosfs_init), move some
  17. initialisation code...
  18.  
  19. Index: biosfs.c
  20. @@ -261,7 +261,7 @@
  21.  {
  22.      struct bios_file *b, *c;
  23.      int majdev, mindev;
  24. -    int i;
  25. +    int i, oldmap = 1;
  26.  
  27.      broot = BDEV;
  28.  
  29. @@ -301,9 +301,10 @@
  30.          --b;
  31.          b->next = 0;
  32.      }
  33. +    if (has_bconmap)
  34. +        oldmap = Bconmap(-1);
  35.      /* Initialize bios_tty structures */
  36.      for (i=0;c && i<MAX_BTTY;c=c->next, i++) {
  37. -        unsigned r;
  38.          if (has_bconmap)
  39.              Bconmap(c->private);
  40.          bttys[i].irec = Iorec(0);
  41. @@ -312,10 +313,9 @@
  42.          bttys[i].wsel = &(c->tty->wsel);
  43.          bttys[i].baudmap = baudmap;
  44.          bttys[i].maxbaud = MAXBAUD;
  45. -        r = (int)rsconf(-2, -1, -1, -1, -1, -1);
  46. -        Rsconf(r, -1, -1, -1, -1, -1);
  47. -        bttys[i].ospeed = bttys[i].ispeed = r<MAXBAUD ? baudmap[r] : -1;
  48.      }
  49. +    if (has_bconmap)
  50. +        Bconmap(oldmap);
  51.      btty_max = i;
  52.  
  53.      defaultaux = new_fileptr();
  54. Index: proc.c
  55. @@ -270,7 +270,8 @@
  56.      curproc->starttime = Tgettime();
  57.      curproc->startdate = Tgetdate();
  58.      if (has_bconmap)
  59. -        curproc->bconmap = curbconmap;
  60. +/* init_xbios not happened yet */
  61. +        curproc->bconmap = (int) Bconmap(-1);
  62.      else
  63.          curproc->bconmap = 1;
  64.  
  65. Index: xbios.c
  66. @@ -10,6 +10,11 @@
  67.  
  68.  #include "mint.h"
  69.  
  70. +/* tty structures for the BIOS devices -- see biosfs.c */
  71. +extern struct tty ttmfp_tty;
  72. +extern struct bios_tty bttys[];
  73. +extern short btty_max;
  74. +
  75.  extern int tosvers;    /* from main.c */
  76.  
  77.  #define XBIOS_MAX 0x80
  78. @@ -160,8 +165,6 @@
  79.  uiorec(dev)
  80.      int dev;
  81.  {
  82. -    extern short btty_max;
  83. -
  84.      TRACE(("Iorec(%d)", dev));
  85.      if (dev == 0 && has_bconmap) {
  86.  /* get around another BIOS Bug:  in (at least) TOS 2.05 Iorec(0) is broken */
  87. @@ -179,9 +182,6 @@
  88.      long rsval;
  89.      static int oldbaud = -1;
  90.      int b, ret_oldbaud = 0;
  91. -    extern struct tty ttmfp_tty;
  92. -    extern struct bios_tty bttys[];
  93. -    extern short btty_max;
  94.  
  95.      TRACE(("Rsconf(%d,%d,%d,%d,%d,%d)", baud, flow,
  96.          uc, rs, ts, sc));
  97. @@ -330,6 +330,8 @@
  98.  void
  99.  init_xbios()
  100.  {
  101. +    int i, oldmap;
  102. +
  103.      curbconmap = (has_bconmap) ? (int) Bconmap(-1) : 1;
  104.  
  105.      xbios_tab[0x0c] = midiws;
  106. @@ -339,4 +341,17 @@
  107.      xbios_tab[0x20] = dosound;
  108.      xbios_tab[0x26] = supexec;
  109.      xbios_tab[0x2c] = bconmap;
  110. +
  111. +    oldmap = curproc->bconmap = curbconmap;
  112. +    for (i=0; i<btty_max; i++) {
  113. +        int r;
  114. +        if (has_bconmap)
  115. +            curproc->bconmap = i+6;
  116. +        r = (int)rsconf(-2, -1, -1, -1, -1, -1);
  117. +        if (r < 0)
  118. +            Rsconf((r=0), -1, -1, -1, -1, -1);
  119. +        rsconf(r, -1, -1, -1, -1, -1);
  120. +    }
  121. +    if (has_bconmap)
  122. +        mapin (curproc->bconmap = oldmap);
  123.  }
  124.  
  125. 2. default no XDEF _bcopy, for gcc 2.3.3 you can -DXDEF_BCOPY
  126. (and save 1 more word)
  127.  
  128. Index: quickmov.spp
  129. @@ -14,6 +14,8 @@
  130.      XDEF    _quickmove
  131.      XDEF    _quickmovb
  132.  
  133. +;*sigh* gcc 2.5.8 wants the libs one...
  134. +%ifdef XDEF_BCOPY
  135.  ;%ifdef OWN_LIB
  136.      XDEF    _bcopy
  137.      XDEF    __bcopy
  138. @@ -24,6 +26,7 @@
  139.      move.l    4(sp),a1        ; get src
  140.      bra.s    _quickmovb1
  141.  ;%endif
  142. +%endif
  143.  
  144.  _quickmovb:
  145.      move.l    4(sp),a0        ; get dst
  146. @@ -51,8 +54,7 @@
  147.      and.w    d0,d1            ; d1 = nbytes % 512
  148.      lsr.l    #8,d0            ; 
  149.      lsr.l    #1,d0            ; d0 = nbytes / 512
  150. -    subq.l    #1,d0            ; prepare for dbra loop
  151. -    bmi.s    Leftover        ; if < 0, skip
  152. +    ble.s    Leftover        ; if <= 0, skip
  153.      movem.l    d1-d7/a2-a6,-(sp)    ; save regs
  154.  L1:
  155.      movem.l    (a1)+,d1-d7/a2-a6    ; read 12*4 = 48 bytes
  156. @@ -80,7 +82,7 @@
  157.  
  158.      lea    512(a0),a0
  159.      subq.l    #1,d0
  160. -    bge.s    L1
  161. +    bgt.s    L1
  162.  
  163.      movem.l    (sp)+,d1-d7/a2-a6    ; pop registers
  164.  
  165. 3. TOS 1.(0)2 had xcon* already...  (or was it too buggy? :)
  166.  
  167. Index: bios.c
  168. @@ -74,22 +74,22 @@
  169.  
  170.  /* and then do BCOSTAT ourselves, the BIOS SCC ones are often broken */
  171.  #define BCOSTAT(dev) \
  172. -    (((unsigned)dev <= 4) ? ((tosvers > 0x0102) ? \
  173. +    (((unsigned)dev <= 4) ? ((tosvers >= 0x0102) ? \
  174.         (int)callout1(xcostat[dev], dev) : Bcostat(dev)) : \
  175.         ((has_bconmap && (unsigned)dev-SERDEV < btty_max) ? \
  176.          bcxstat(MAPTAB[dev-SERDEV].iorec+1) : Bcostat(dev)))
  177.  #define BCONOUT(dev, c) \
  178. -    (((unsigned)dev <= 4) ? ((tosvers > 0x0102) ? \
  179. +    (((unsigned)dev <= 4) ? ((tosvers >= 0x0102) ? \
  180.         callout2(xconout[dev], dev, c) : Bconout(dev, c)) : \
  181.         ((has_bconmap && (unsigned)dev-SERDEV < btty_max) ? \
  182.          callout2(MAPTAB[dev-SERDEV].bconout, dev, c) : Bconout(dev, c)))
  183.  #define BCONSTAT(dev) \
  184. -    (((unsigned)dev <= 4) ? ((tosvers > 0x0102) ? \
  185. +    (((unsigned)dev <= 4) ? ((tosvers >= 0x0102) ? \
  186.         (int)callout1(xconstat[dev], dev) : Bconstat(dev)) : \
  187.         ((has_bconmap && (unsigned)dev-SERDEV < btty_max) ? \
  188.          (int)callout1(MAPTAB[dev-SERDEV].bconstat, dev) : Bconstat(dev)))
  189.  #define BCONIN(dev) \
  190. -    (((unsigned)dev <= 4) ? ((tosvers > 0x0102) ? \
  191. +    (((unsigned)dev <= 4) ? ((tosvers >= 0x0102) ? \
  192.         callout1(xconin[dev], dev) : Bconin(dev)) : \
  193.         ((has_bconmap && (unsigned)dev-SERDEV < btty_max) ? \
  194.          callout1(MAPTAB[dev-SERDEV].bconin, dev) : Bconin(dev)))
  195. Index: biosfs.c
  196. @@ -1357,7 +1357,7 @@
  197.              cout = &MAPTAB[bdev-6].bconout;
  198.              ospeed = &bttys[bdev-6].ospeed;
  199.          }
  200. -    } else if (bdev == 1 && tosvers > 0x0102) {
  201. +    } else if (bdev == 1 && tosvers >= 0x0102) {
  202.          ior = bttys[0].orec;
  203.          cout = &xconout[1];
  204.          ospeed = &bttys[0].ospeed;
  205. @@ -1534,7 +1537,7 @@
  206.      unsigned short head, bsize, wrap;
  207.      long left;
  208.  
  209. -    if (bdev == 3 && tosvers > 0x0102) {
  210. +    if (bdev == 3 && tosvers >= 0x0102) {
  211.          /* midi */
  212.          ior = (IOREC_T *) uiorec(2);
  213.          cin = &xconin[3];
  214. @@ -1545,7 +1548,7 @@
  215.              cin = &MAPTAB[bdev-6].bconin;
  216.              cinstat = &MAPTAB[bdev-6].bconstat;
  217.          }
  218. -    } else if (bdev == 1 && tosvers > 0x0102) {
  219. +    } else if (bdev == 1 && tosvers >= 0x0102) {
  220.          ior = bttys[0].irec;
  221.          cin = &xconin[1];
  222.          cinstat = &xconstat[1];
  223.  
  224. 4. fix ^S on ptys, allow sleeping for TS_HOLD (only on devices that have
  225. writeb for compatibility with older ones so it currently only works on
  226. ptys), and some more things like pty master read end looks at TS_HOLD too
  227. to reduce delay.  devices that have writeb are now notified when TS_HOLD
  228. changes (ioctl TIOCSTART/STOP) but they still don't need to wake writers
  229. themselves unless they change TS_HOLD themselves.
  230.  
  231. Index: pipefs.c
  232. @@ -471,6 +471,7 @@
  233.              return ENSMEM;
  234.          }
  235.          tty->use_cnt = 0;
  236. +        tty->rsel = tty->wsel = 0;
  237.              /* do_open does the rest of tty initialization */
  238.      } else tty = 0;
  239.  
  240. @@ -615,6 +616,13 @@
  241.  
  242.      if (nbytes > 0 && nbytes <= PIPE_BUF) {
  243.  check_atomicity:
  244. +        if (is_terminal(f) && !(f->flags & O_HEAD) &&
  245. +            (this->tty->state & TS_HOLD)) {
  246. +            if (f->flags & O_NDELAY)
  247. +                return 0;
  248. +            sleep (IO_Q, (long)&this->tty->state);
  249. +            goto check_atomicity;
  250. +        }
  251.          r = p->tail - p->head;
  252.          if (r < 0) r += PIPESIZ+4;
  253.          r = PIPESIZ - r; /* r is the number of bytes we can write */
  254. @@ -647,6 +655,13 @@
  255.  #if 1
  256.              int free, wrap;
  257.  
  258. +            if (is_terminal(f) && !(f->flags & O_HEAD) &&
  259. +                (this->tty->state & TS_HOLD)) {
  260. +                if (f->flags & O_NDELAY)
  261. +                    break;
  262. +                sleep (IO_Q, (long)&this->tty->state);
  263. +                continue;
  264. +            }
  265.              pbuf = p->buf + ptail;
  266.              if ((free = phead - j) < 0)
  267.                  free += PIPESIZ+4;
  268. @@ -673,8 +688,8 @@
  269.              } else {
  270.                  if (wrap <= free) {
  271.                      memcpy (pbuf, buf, wrap);
  272. -                    memcpy (p->buf, buf + wrap, free - wrap);
  273.                      ptail = free - wrap;
  274. +                    memcpy (p->buf, buf + wrap, ptail);
  275.                  } else {
  276.                      memcpy (pbuf, buf, free);
  277.                      ptail += free;
  278. @@ -760,6 +775,13 @@
  279.                  left += PIPESIZ+4;
  280.              if (left > nbytes)
  281.                  left = nbytes;
  282. +/* if pty master and TS_HOLD set stop reading (makes ^S work faster) */
  283. +            if (is_terminal(f) && (f->flags & O_HEAD) &&
  284. +                (this->tty->state & TS_HOLD)) {
  285. +                if (bytes_read || (f->flags & O_NDELAY))
  286. +                    break;
  287. +                left = 1;
  288. +            }
  289.              nbytes -= left;
  290.              bytes_read += left;
  291.  
  292. @@ -774,8 +796,8 @@
  293.              } else {
  294.                  if (wrap <= left) {
  295.                      memcpy (buf, pbuf, wrap);
  296. -                    memcpy (buf + wrap, p->buf, left - wrap);
  297.                      phead = left - wrap;
  298. +                    memcpy (buf + wrap, p->buf, phead);
  299.                  } else {
  300.                      memcpy (buf, pbuf, left);
  301.                      phead += left;
  302. @@ -909,8 +931,12 @@
  303.              } else {
  304.                  r = p->tail - p->head;
  305.                  if (r < 0) r += PIPESIZ+4;
  306. -                if (is_terminal(f) && !(f->flags & O_HEAD))
  307. -                    r = r >> 2;    /* r /= 4 */
  308. +                if (is_terminal(f)) {
  309. +                    if (!(f->flags & O_HEAD))
  310. +                        r = r >> 2;    /* r /= 4 */
  311. +                    else if (this->tty->state & TS_HOLD)
  312. +                        r = 0;
  313. +                }
  314.                  if (!r && p->writers <= 0) {
  315.                      DEBUG(("pipe FIONREAD: no writers"));
  316.                      r = -1;
  317. @@ -927,8 +953,12 @@
  318.                  r = p->tail - p->head;
  319.                  if (r < 0) r += PIPESIZ+4;
  320.                  r = PIPESIZ - r;
  321. -                if (is_terminal(f) && (f->flags & O_HEAD))
  322. -                    r = r >> 2;    /* r /= 4 */
  323. +                if (is_terminal(f)) {
  324. +                    if (f->flags & O_HEAD)
  325. +                        r = r >> 2;    /* r /= 4 */
  326. +                    else if (this->tty->state & TS_HOLD)
  327. +                        r = 0;
  328. +                }
  329.              }
  330.              *((long *) buf) = r;
  331.              break;
  332. @@ -975,6 +1005,11 @@
  333.          else
  334.              lck->l_type = F_UNLCK;
  335.          break;
  336. +    case TIOCSTART:
  337. +        if (is_terminal(f) && !(f->flags & O_HEAD) &&
  338. +            (p = this->outp) && p->rsel && p->tail != p->head)
  339. +            wakeselect (p->rsel);
  340. +        break;
  341.      case TIOCFLUSH:
  342.          {
  343.          long flushtype;
  344. @@ -1203,13 +1238,18 @@
  345.          }
  346.  
  347.  /* NOTE: if p->writers <= 0 then reads won't block (they'll fail) */
  348. -        if (p->tail != p->head || p->writers <= 0) {
  349. +        if ((p->tail != p->head &&
  350. +            (!is_terminal(f) || !(f->flags & O_HEAD) ||
  351. +             !(this->tty->state & TS_HOLD))) ||
  352. +            p->writers <= 0) {
  353.              return 1;
  354.          }
  355.  
  356.          if (p->rsel)
  357.              return 2;    /* collision */
  358.          p->rsel = proc;
  359. +        if (is_terminal(f) && !(f->flags & O_HEAD))
  360. +            this->tty->rsel = proc;
  361.          return 0;
  362.      } else if (mode == O_WRONLY) {
  363.          p = (f->flags & O_HEAD) ? this->inp : this->outp;
  364. @@ -1219,11 +1259,16 @@
  365.          }
  366.          j = p->tail+4;
  367.          if (j >= PIPESIZ+4) j -= PIPESIZ+4;
  368. -        if (j != p->head || p->readers <= 0)
  369. +        if ((j != p->head &&
  370. +            (!is_terminal(f) || (f->flags & O_HEAD) ||
  371. +             !(this->tty->state & TS_HOLD))) ||
  372. +            p->readers <= 0)
  373.              return 1;    /* data may be written */
  374.          if (p->wsel)
  375.              return 2;    /* collision */
  376.          p->wsel = proc;
  377. +        if (is_terminal(f) && !(f->flags & O_HEAD))
  378. +            this->tty->wsel = proc;
  379.          return 0;
  380.      }
  381.      return 0;
  382. Index: tty.c
  383. @@ -16,6 +16,11 @@
  384.  /* setting a special character to this value disables it */
  385.  #define UNDEF 0
  386.  
  387. +#define HAS_WRITEB(f)    (((f)->fc.fs != &bios_filesys || \
  388. +             (((struct bios_file *)(f)->fc.index)->drvsize > \
  389. +                offsetof (DEVDRV, writeb))) && \
  390. +             *(f)->dev->writeb)
  391. +extern FILESYS bios_filesys;
  392.  
  393.  /* default terminal characteristics */
  394.  
  395. @@ -87,7 +92,6 @@
  396.      unsigned char ch, *ptr;
  397.      int rdmode, mode;
  398.      struct tty *tty;
  399. -    extern FILESYS bios_filesys;
  400.  
  401.      tty = (struct tty *)f->devinfo;
  402.      assert(tty != 0);
  403. @@ -117,8 +121,8 @@
  404.           ((struct bios_file *)f->fc.index)->drvsize >
  405.              offsetof (DEVDRV, readb))) &&
  406.          *f->dev->readb &&
  407. -        ((f->flags & O_HEAD) ||
  408. -        !tty->pgrp || tty->pgrp == curproc->pgrp ||
  409. +        ((f->flags & O_HEAD) || ((tty->state &= ~TS_COOKED), !tty->pgrp) ||
  410. +        tty->pgrp == curproc->pgrp ||
  411.          f->fc.dev != curproc->control->fc.dev ||
  412.          f->fc.index != curproc->control->fc.index) &&
  413.          (bytes_read = (*f->dev->readb)(f, buf, nbytes)) != EUNDEV)
  414. @@ -299,7 +303,6 @@
  415.      static long cr_char = '\r';
  416.  #define LBUFSIZ 128
  417.      long lbuf[LBUFSIZ];
  418. -    extern FILESYS bios_filesys;
  419.  
  420.      tty = (struct tty *)f->devinfo;
  421.      assert(tty != 0);
  422. @@ -330,12 +333,13 @@
  423.  
  424.  #if 1
  425.      /* see if we can do fast RAW byte IO thru the device driver... */
  426. -    if (!use_putchar &&
  427. -        (f->fc.fs != &bios_filesys ||
  428. -        (((struct bios_file *)f->fc.index)->drvsize >
  429. -            offsetof (DEVDRV, writeb))) && *f->dev->writeb) {
  430. +    if (!use_putchar && HAS_WRITEB(f)) {
  431.  
  432.          tty_checkttou (f, tty);
  433. +        if (rwmode & COOKED)
  434. +            tty->state |= TS_COOKED;
  435. +        else
  436. +            tty->state &= ~TS_COOKED;
  437.          if (mode) {    /* i.e. T_CRMODE */
  438.              if ((*f->dev->writeb)(f, buf, 0L) != EUNDEV) {
  439.      /* write in big chunks if possible; lines if CRMODE
  440. @@ -637,9 +641,26 @@
  441.          tty->pgrp = (*((long *)arg) & 0x00007fffL);
  442.          return 0;
  443.      case TIOCSTART:
  444. +/* if the device has writeb writers may sleep for TS_HOLD (instead of polling),
  445. + * tell the device and wake them up
  446. + */
  447. +        if (HAS_WRITEB(f)) {
  448. +            (void)(*f->dev->ioctl)(f, TIOCSTART, &tty->state);
  449. +            tty->state &= ~TS_HOLD;
  450. +            wake (IO_Q, (long)&tty->state);
  451. +            if (tty->wsel) {
  452. +                long r = 0;
  453. +
  454. +                (void)(*f->dev->ioctl)(f, FIONWRITE, &r);
  455. +                if (r)
  456. +                    wakeselect (tty->wsel);
  457. +            }
  458. +        }
  459.          tty->state &= ~TS_HOLD;
  460.          return 0;
  461.      case TIOCSTOP:
  462. +        if (HAS_WRITEB(f))
  463. +            (void)(*f->dev->ioctl)(f, TIOCSTOP, &tty->state);
  464.          tty->state |= TS_HOLD;
  465.          return 0;
  466.      case TIOCGXKEY:
  467. @@ -824,9 +845,9 @@
  468.              else if (c == tty->tc.t_quitc)
  469.                  killgroup(curproc->pgrp, SIGQUIT);
  470.              else if (c == tty->tc.t_stopc)
  471. -                tty->state |= TS_HOLD;
  472. +                tty_ioctl (f, TIOCSTOP, 0);
  473.              else if (c == tty->tc.t_startc)
  474. -                tty->state &= ~TS_HOLD;
  475. +                tty_ioctl (f, TIOCSTART, 0);
  476.              else
  477.                  c = UNDEF;
  478.          }
  479. @@ -863,28 +884,36 @@
  480.          ch = data & 0xff;
  481.  
  482.          if ( (tty->state & TS_COOKED) && ch != UNDEF) {
  483. +            long r = 1;
  484. +
  485.  /* see if we're putting control characters into the buffer */
  486.              if (ch == tty->tc.t_intrc) {
  487. -                tty->state &= ~TS_HOLD;
  488.                  killgroup(tty->pgrp, SIGINT);
  489. +                if (!(tty->sg.sg_flags & T_NOFLSH))
  490. +                    (void)(*f->dev->ioctl)(f, TIOCFLUSH, &r);
  491. +                tty_ioctl (f, TIOCSTART, 0);
  492.                  return 4L;
  493.              }
  494.              else if (ch == tty->tc.t_quitc) {
  495. -                tty->state &= ~TS_HOLD;
  496.                  killgroup(tty->pgrp, SIGQUIT);
  497. +                if (!(tty->sg.sg_flags & T_NOFLSH))
  498. +                    (void)(*f->dev->ioctl)(f, TIOCFLUSH, &r);
  499. +                tty_ioctl (f, TIOCSTART, 0);
  500.                  return 4L;
  501.              }
  502.              else if (ch == tty->ltc.t_suspc) {
  503. -                tty->state &= ~TS_HOLD;
  504.                  killgroup(tty->pgrp, SIGTSTP);
  505. +                if (!(tty->sg.sg_flags & T_NOFLSH))
  506. +                    (void)(*f->dev->ioctl)(f, TIOCFLUSH, &r);
  507. +                tty_ioctl (f, TIOCSTART, 0);
  508.                  return 4L;
  509.              }
  510.              else if (ch == tty->tc.t_stopc) {
  511. -                tty->state |= TS_HOLD;
  512. +                tty_ioctl (f, TIOCSTOP, 0);
  513.                  return 4L;
  514.              }
  515.              else if (ch == tty->tc.t_startc) {
  516. -                tty->state &= ~TS_HOLD;
  517. +                tty_ioctl (f, TIOCSTART, 0);
  518.                  return 4L;
  519.              }
  520.              else if (tty->state & TS_HOLD) {
  521. @@ -947,7 +976,13 @@
  522.                  } else if (c == tty->tc.t_startc)
  523.                      tty->state &= ~TS_HOLD;
  524.              }
  525. +            else
  526.  #endif
  527. +            if (HAS_WRITEB(f)) {
  528. +/* if the device has writeb assume it wakes us when TS_HOLD resets */
  529. +                sleep (IO_Q, (long)&tty->state);
  530. +                continue;
  531. +            }
  532.              nap(60);    /* sleep for 60 milliseconds */
  533.          }
  534.      }
  535. Index: biosfs.c
  536. @@ -1519,7 +1519,10 @@
  537.  {
  538.      int bdev = f->fc.aux;
  539.      struct bios_file *b = (struct bios_file *)f->fc.index;
  540. +    struct tty *tty = (struct tty *)f->devinfo;
  541.  
  542. +    if (!(tty->sg.sg_flags & T_RAW) || (tty->sg.sg_flags & T_ECHO))
  543. +        return EUNDEV;
  544.      return iread (bdev, buf, bytes, (f->flags & O_NDELAY), b);
  545.  }
  546.  
  547. 5. that silly ENOMEM-because-process-did-not-Mshrink-yet `feature' again...
  548. will this be finally enough so i don't see it again? :)
  549.  
  550. Index: proc.c
  551. @@ -322,9 +323,10 @@
  552.  fresh_slices(slices)
  553.      int slices;
  554.  {
  555. +    reset_priorities();
  556.      curproc->slices = 0;
  557.      curproc->curpri = MAX_NICE+1;
  558. -    proc_clock = slices;
  559. +    proc_clock = TIME_SLICE+slices;
  560.  }
  561.  
  562.  /*
  563. @@ -460,7 +462,7 @@
  564.      if (p->slices >= 0) {
  565.          proc_clock = TIME_SLICE;    /* get a fresh time slice */
  566.      } else {
  567. -        proc_clock = -p->slices;    /* slices set by run_next */
  568. +        proc_clock = TIME_SLICE-p->slices; /* slices set by run_next */
  569.          p->curpri = p->pri;
  570.      }
  571.      p->slices = SLICES(p->curpri);
  572.  
  573.  all the best...
  574.     Juergen
  575.